﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class ContentPage
    {
        public virtual int ContentPageId { get; set; }
        public virtual PageTemplate PageTemplate { get; set; }
        public virtual string MetaTitle { get; set; }
        public virtual string MetaContent { get; set; }
        public virtual string Content { get; set; }
        public virtual string Header { get; set; }
        public virtual bool Enabled { get; set; }
        public virtual DateTime PublishDate { get; set; }
    }

    public class ContentPageMap : ClassMap<ContentPage>
    {
        public ContentPageMap()
        {
            Id(x => x.ContentPageId).GeneratedBy.HiLo("contentpage");
            Id(x => x.ContentPageId).Unique();
            References(x => x.PageTemplate).Column("PageTemplateId");
            Map(x => x.Content);
            Map(x => x.MetaContent);
            Map(x => x.MetaTitle);
            Map(x => x.Header);
            Map(x => x.Enabled);
            Map(x => x.PublishDate);
            Table("ContentPage");
        }
    }
}
